package com.handinfo.android.game;

import java.io.DataInputStream;
import java.io.IOException;

public class GameCarbon
{
	private String m_name = null;//副本名称
	private byte m_difficulty = 0;//副本难度
	private String m_key = null;//副本key
	private int m_lv = 0;//副本等级
	private int m_vim = 0; //精力
	//	private byte m_day_yet = 0;//普通每日进入次数
//	private byte m_day_max = 0;//普通每次进入上限
//	public byte m_extra_yet = 0;//额外每日进入次数
//	public byte m_extra_max = 0;//额外每日进入上限
	private byte m_status = 0;//当前状态
	private String m_info;//介绍说明
	public final byte STATUS_JOIN = 0;//参加
	public final byte STATUS_LINE_UP = 1;//排队中
	public final byte STATUS_ADD = 2;//增次
	public final byte STATUS_NO_INTO = 5;//不可进入

	public static final String[] STATUS_DESCRIBE = { "", "<mark c=00FF00>排队中</mark>",
			"<mark c=FFBB11>增加次数</mark>", "<mark c=FF0000>次数耗尽</mark>", "<mark c=FFBB11>队长控制</mark>",
			"<mark c=FF0000>不可进入</mark>" };//3 5 红色  2 4 黄色   1 绿色

//	public void drawCarbon(Graphics g, int x, int y, int w, int h) {
//		g.setColor(UIManager.getPaletteColor(UIPalette.COLOR_WORD_NOS));
//		g.drawString(m_name + "(" + m_lv + "级)", x + UITools.GAP_LEFT, y + UITools.GAP_UP, Tools.LEFT_TOP);
//		g.drawString("今日次数 : " + m_day_yet + "/" + m_day_max + "次",
//				x + UITools.GAP_LEFT, y + UITools.H_SINGLE_BAR + UITools.GAP_UP, Tools.LEFT_TOP);
//		g.drawString("副本状态 : " + STATUS_DESCRIBE[m_status], x + UITools.GAP_LEFT,
//				y + (UITools.H_SINGLE_BAR << 1) + UITools.GAP_UP, Tools.LEFT_TOP);
//		g.setColor(Tools.WHITE);
//		g.drawRect(x, y, w, h);
//	}
	public void read(DataInputStream dis) throws IOException
	{
		m_key = dis.readUTF();
		m_name = dis.readUTF();
		m_difficulty = dis.readByte();
		m_lv = dis.readInt();
		m_vim = dis.readInt();
//		m_day_yet = dis.readByte();
//		m_day_max = dis.readByte();
		m_status = dis.readByte();
	}

	public void updateStatus(byte status)
	{
		m_status = status;
	}

	public byte getStatus()
	{
		return m_status;
	}

	public String getKey()
	{
		return m_key;
	}

	public String getName()
	{
		return m_name;
	}

	public byte getDifficulty()
	{
		return m_difficulty;
	}

//	public byte getDayyet() {
//		return m_day_yet;
//	}
//	public byte getDaymax() {
//		return m_day_max;
//	}
	public int getLv()
	{
		return m_lv;
	}

	public int getM_vim()
	{
		return m_vim;
	}

	public void read(int i)
	{
		m_name = "万宝阁" + (i + 1);
		m_lv = (byte) (20 + i);
//		m_day_yet = (byte)(0 + i);
//		m_day_max = (byte)(1 + i);
	}
}
